import http from '@/utils/http'
import axios from 'axios'

const CustomerInfoManageServer = {

  /**
   * 获取我的客户数据列表
   * @param {*} params
   * @returns  
   */
  async getCustListJson(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/getCustList`,
      params: params,
      method: 'GET'
    })
    return result;
  },

  // 客户基本信息 操作日志
  async getCustLogList(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/getCustLogList`,
      params: params,
      method: 'GET'
    })
    return result;
  },
  // 客户基本信息-营销责任地
  async getCommonRegionList(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/getCommenRegionList`,
      params: params,
      method: 'GET'
    })
    return result;
  },
  // 客户基本信息-行业类型
  async getIndustryType(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/getIndustryType`,
      params: params,
      method: 'GET'
    })
    return result;

  },
   // 客户基本信息-审核历史
   async getCustAuditList(params) {
    let result = await http({
             url: `${process.env.VUE_APP_CTX_CUST}/getCustAuditList`,
           params: params,
           method:'GET'
       })
       return result;
    
 },
  // 客户基本信息-//客户审核历史tree 初始化
  async getCustAuditHis(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/getCustAuditHis`,
      params: params,
      method: 'GET'
    })
    return result;

  },
  // 客户基本信息-改名改证件tree 初始化
  async getIndustryTypeChangeNameTree(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/getIndustryTypeZ`,
      params: params,
      method: 'GET'
    })
    return result;

  },

  // 新建客户 -下一步操作
  async setNewCustomer(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/saveParty`,
      data: params,
      method: 'POST'
    })
    return result;

  },
  // 新建客户 -初始化服务
  async initParty(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/initParty`,
      params: params,
      method: 'GET'
    })
    return result;

  },
  // 新建客户 -查询省客户服务
  async getProvinceCust(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/getProvinceCust`,
      params: params,
      method: 'GET'
    })
    return result;

  },
  // 新建客户 -查询省客户服务
  async saveProvCust(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/saveProvCust`,
      data: params,
      method: 'POST'
    })
    return result;

  },
  // 新建客户 - 接口异常
  async ceratyParty(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/ceratyParty`,
      data: params,
      method: 'POST'
    })
    return result;

  },
  // 客户视图-身份证基本信息-初始化
  async initGetPartyNews(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/getPartyNews`,
      params: params,
      method: 'GET'
    })
    return result;

  },
  // 客户视图-基本信息-初始化
  async getCustCommon(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/getCustCommon`,
      params: params,
      method: 'GET'
    })
    return result;
  },
  // 客户视图-身份证信息-身份信息填报
  async saveCustNews(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/saveCustNews`,
      data: params,
      method: 'post'
    })
    return result;
  },

  // 客户基本信息
  async initCustDetail(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/getCustDetail`,
      data: params,
      method: 'GET'
    })
    return result;
  },
  // 初始化下拉框列表
  async initValue(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/getBasicsdata`,
      params: params,
      method: 'GET'
    })
    return result;
  },
  // 客户经理列表
  async getManagerList(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/getManagerList`,
      params: params,
      method: 'GET'
    })
    return result;
  },
  // 改名改证件
  async changeNameSave(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/saveCustRealNews`,
      data: params,
      method: 'POST'
    })
    return result;
  },
  // 客户基本信息-客户附件列表-接口
  async getCustFileList(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/getCustFileList`,
      params: params,
      method: 'GET'
    })
    return result;
  },
  // 修改页初始化客户经理列表
  async getStaffList(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/getStaffList`,
      params: params,
      method: 'GET'
    })
    return result;
  },
  // 修改页初始化客户经理列表
  async delCustFile(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/delCustFile`,
      data: params,
      method: 'post'
    })
    return result;
  },
  // 修改页信息修改完成保存接口
  async updateCustNews(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/updateCustNews`,
      data: params,
      method: 'post'
    })
    return result;
  },
  // 信息修改页-判断当前登录人是否为客户运营岗
  async checkIsOperate(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/checkIsOperate`,
      params: params,
      method: 'get'
    })
    return result;
  },

  // 客户视图-订单信息-项目信息接口
  async qryCustOnLineList(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_ORDER_QUERY}/qryCustOnLineList`,
      data: params,
      method: 'post'
    })
    return result;
  },
  // 客户视图-订单信息-销售品接口-接口
  async qryOrderItem(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_ORDER_QUERY}/qryOrderItem`,
      data: params,
      method: 'post'
    })
    return result;
  },
  // 客户视图-关键人信息
  async getCustKeyPersonRelList(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/getCustKeyPersonRelList`,
      params: params,
      method: 'GET'
    })
    return result;
  },
  //客户联系人-联系人列表
  async getContInfoList(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/getContInfoList`,
      params: params,
      method: 'get'
    })
    return result;
  },
  //客户联系人-删除联系人
  async delContInfo(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/delContInfo`,
      data: params,
      method: 'post'
    })
    return result;
  },
  //客户联系人-查看联系人信息
  async getContInfoNews(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/getContInfoNews`,
      params: params,
      method: 'get'
    })
    return result;
  },
  //客户联系人-新建联系人
  async saveContInfo(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/saveContInfo`,
      data: params,
      method: 'post'
    })
    return result;
  },
  //客户联系人-修改联系人
  async updateContInfo(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/updateContInfo`,
      data: params,
      method: 'post'
    })
    return result;
  },
  // 客户联系人-设为首选联系人
  async setContInfo(params){
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/setContInfo`,
      data: params,
      method:'post'
  })
     return result;
  },
  //客户列表-上传附件
  async saveCustFile(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/saveCustFile`,
      headers: {
        'Content-Type': 'multipart/form-data'
      },
      data: params,
      method: 'post'
    })
    return result;
  },
  //   账户列表
  async getAccountList(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/getAccountList`,
      params: params,
      method: 'GET'
    })
    return result;
  },
  // 客户基本信息-客户割接通知信息
  async getCustDetail(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/getCustDetail`,
      params: params,
      method: 'GET'
    })
    return result;
  },
  // 客户割接通知-割接通知信息
  async getCustCutInfoList(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/getCustCutInfoList`,
      params: params,
      method: 'GET'
    })
    return result;
  },
  // 客户割接通知-接收单位联系信息列表
  async getContInfoList(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/getContInfoList`,
      params: params,
      method: 'GET'
    })
    return result;
  },
   // 客户割接通知-保存接口
   async saveCustCutInfo(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/saveCustCutInfo`,
      data: params,
      method: 'post'
    })
    return result;
  },
   //   客户在审核中服务权限
   async checkCustAudit(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/checkCustAudit`,
      params: params,
      method: 'GET'
    })
    return result;
  },
  //   客户列表-删除客户
  async deleteCust(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/deleteCust`,
      data: params,
      method: 'POST'
    })
    return result;
  },
  //   客户列表-客户送审核
  async sendCustAudit(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/sendCustAudit`,
      data: params,
      method: 'POST'
    })
    return result;
  },
   //   客户在审核中服务权限
   async getCustTaxDetail(params) {
    let result = await http({
      url: `${process.env.VUE_APP_CTX_CUST}/getCustTaxDetail`,
      params: params,
      method: 'GET'
    })
    return result;
  },
    //   登陆人信息
    async getLoginUserInfo(params) {
      let result = await http({
        url: `${process.env.VUE_APP_CTX_CUST}/getLoginUserInfo`,
        data: params,
        method: 'GET'
      })
      return result;
    },
    // 客户列表-附件上传列表-下载功能
    async getCustFile(params) {
      let result = await http({
        url: `${process.env.VUE_APP_CTX_CUST}/getCustFile`,
        params: params,
        headers: {'Content-Type': 'application/json'},
        responseType: 'blob',
        method: 'get'
      })
      return result;
    },
    // 证件照片回显
    async getCustPhoto(params) {
      let result = await http({
        url: `${process.env.VUE_APP_CTX_CUST}/getCustPhoto`,
        params: params,
        headers: {'Content-Type': 'application/json'},
        method: 'get'
      })
      return result;
    },
      // 客户视图-业务信息
      async qryOfferInstList(params) {
        let result = await http({
          url: `${process.env.VUE_APP_CTX_ORDER_QUERY}/qryOfferInstList`,
          data: params,
          method: 'post'
        })
        return result;
      },
      // 审核人接口
      async getAuditorList(params) {
        let result = await http({
          url: `${process.env.VUE_APP_CTX_CUST}/getAuditorList`,
          params: params,
          method: 'get'
        })
        return result;
      },
      //权限接口
      async getDesensPriv(params) {
        let result = await http({
          url: `${process.env.VUE_APP_CTX_CUST}/getDesensPriv`,
          params: params,
          method: 'get'
        })
        return result;
      },
      //获取脱敏信息
      async getDesensAttr(params) {
        let result = await http({
          url: `${process.env.VUE_APP_CTX_CUST}/getDesensAttr`,
          params: params,
          method: 'get'
        })
        return result;
      },
}
export default CustomerInfoManageServer
